using System;
using UnityEngine;
using Yoozoo.Mars.Got;

namespace Yoozoo.Core.Common
{

    [Serializable]
    public class QualityAdjusterLimit
    {
        [Header("限制的抗锯齿大小")][Range(0,3)]
        public int limitMSAALevel;
    }
    
    
    [Serializable]
    public class QualityAdjusterSetting
    {
        public QualityEnum quality;

        public QualityAdjusterLimit adjusterLimit;
        
        [Header("Fps等级")][Range(0,3)]
        public int fpsLevel;
        
        [Header("渲染精度")][Range(0,4)]
        public int renderPrecisionQuality;

        [Header("原始分辨率百分比")][Range(10,100)]
        public float resolutionPercent;
        // [Header("最小分辨率")][Range(360,2560)]
        // public int minScreenWidth;
        // [Header("最大分辨率")][Range(360,2560)]
        // public int maxScreenWidth;
        
        [Header("阴影质量")][Range(0,5)]
        public int shadowLevel;
        [Header("光影质量")][Range(0,4)]
        public int lightingLevel;

        [Header("角色品质")][Range(0,4)] 
        public int characterGraphicLevel;
        [Header("场景品质")] [Range(0,5)] 
        public int sceneGraphicLevel;
        [Header("特效品质")][Range(0,4)]
        public int fxEffectLevel;
       
        [Header("后效品质")][Range(0,4)]
        public int postEffectLevel;
        [Header("后效风格")][Range(0,5)]
        public int postEffectStyle;
        
        
        [Header("挂机远景距离")][Range(200,1000)]
        public float farClipDistance;
        [Header("挂机摄像机Fov")][Range(40,60)]
        public float fov;
        [Header("挂机Npc数量")][Range(0,60)]
        public int npcCount;
        [Header("挂机车辆数量")][Range(0,60)]
        public int carCount;

        [Header("高对比度")]
        public int HDR;
        [Header("抗锯齿")][Range(0,3)]
        public int MSAALevel;


        public int GetQualityValue()
        {
            return (int)quality;
        }
        
        public static QualityAdjusterSetting Clone(QualityAdjusterSetting origin)
        {
            QualityAdjusterSetting adjusterSetting = new QualityAdjusterSetting();
            adjusterSetting.quality = origin.quality;
            adjusterSetting.fpsLevel = origin.fpsLevel;
            adjusterSetting.renderPrecisionQuality = origin.renderPrecisionQuality;
            adjusterSetting.resolutionPercent = origin.resolutionPercent;
            // adjusterSetting.minScreenWidth = origin.minScreenWidth;
            // adjusterSetting.maxScreenWidth = origin.maxScreenWidth;
            adjusterSetting.shadowLevel = origin.shadowLevel;
            adjusterSetting.lightingLevel = origin.lightingLevel;
            adjusterSetting.characterGraphicLevel = origin.characterGraphicLevel;
            adjusterSetting.sceneGraphicLevel = origin.sceneGraphicLevel;
            adjusterSetting.fxEffectLevel = origin.fxEffectLevel;
            adjusterSetting.postEffectLevel = origin.postEffectLevel;
            adjusterSetting.postEffectStyle = origin.postEffectStyle;
            adjusterSetting.farClipDistance = origin.farClipDistance;
            adjusterSetting.fov = origin.fov;
            adjusterSetting.npcCount = origin.npcCount;
            adjusterSetting.carCount = origin.carCount;
            adjusterSetting.HDR = origin.HDR;
            adjusterSetting.MSAALevel = origin.MSAALevel;

            adjusterSetting.adjusterLimit = new QualityAdjusterLimit()
            {
                limitMSAALevel = origin.adjusterLimit.limitMSAALevel,
            };
            
            return adjusterSetting;
        }

        public static bool Equal(QualityAdjusterSetting origin, QualityAdjusterSetting adjusterSetting)
        {
            return false;
        }
    }
}